﻿<Page
    x:Class="NFCTrigger.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{StaticResource PageBackground}"
    Loaded="Page_Loaded">

    <Grid>
        <StackPanel x:Name="PanelNoNfc" Visibility="Collapsed">
            <Viewbox Margin="100,0,100,-7" HorizontalAlignment="Center">
                <Grid>
                    <Path Data="M33.245033,38.267002C33.745007,38.266979,34.24287,38.330002,34.725391,38.455589L34.753094,38.46357 34.607914,38.83115C34.073689,40.287548 33.782001,41.859955 33.782001,43.499149 33.782001,45.606899 34.264179,47.604179 35.124073,49.386398L35.20993,49.553829 35.175865,49.568485C32.935261,50.4687 30.307802,49.948276 28.645309,48.059708 26.527325,45.659943 26.810284,41.97295 29.257309,39.785988 30.404808,38.76976 31.833338,38.267067 33.245033,38.267002z M43.078392,36.394001L40.268002,39.204571 44.563007,43.499515 40.268002,47.794479 43.078392,50.604999 47.373497,46.309959 51.668598,50.604999 54.479,47.794479 50.183987,43.499515 54.479,39.204571 51.668598,36.394001 47.373497,40.689056z M47.373165,32.907001C53.222565,32.907001 57.964001,37.648517 57.964001,43.497421 57.964001,49.348255 53.222565,54.090999 47.373165,54.090999 41.524418,54.090999 36.783001,49.348255 36.783001,43.497421 36.783001,37.648517 41.524418,32.907001 47.373165,32.907001z M33.013165,20.498834C36.110596,20.472483 39.214424,21.068373 42.195992,22.326485 45.938488,24.023807 49.317997,27.106447 52.60561,30.667299L53.052052,31.155847 52.659004,30.97785C51.0336,30.289106 49.247372,29.908001 47.373699,29.908001 44.328438,29.908001 41.51429,30.914356 39.246063,32.61182L39.027828,32.78342 38.805565,32.643951C33.063362,29.130442,28.077692,30.322496,20.81399,36.946113L20.40099,37.313309 13.626988,29.658399 14.032989,29.282102C19.415426,23.626449,26.198816,20.556812,33.013165,20.498834z M34.073677,0.0013265521C39.264679,0.04313548 44.36026,1.0753696 48.87973,3.4114593 57.486866,8.1243018 62.65794,12.759045 66.667,17.20429L58.51088,24.436001C54.721821,20.260252 50.414753,16.300001 44.458668,13.26944 32.062481,7.4095119 15.911238,12.43095 7.4391122,21.796034L7.0151043,22.181429 0,14.241426 0.42900658,13.854732C6.9186969,6.2559875,20.807785,-0.10551564,34.073677,0.0013265521z" Stretch="Uniform" Fill="#FFFFFFFF" Width="93" Height="93" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
                        <Path.RenderTransform>
                            <TransformGroup>
                                <TransformGroup.Children>
                                    <RotateTransform Angle="0" />
                                    <ScaleTransform ScaleX="-1" ScaleY="1" />
                                </TransformGroup.Children>
                            </TransformGroup>
                        </Path.RenderTransform>
                    </Path>
                </Grid>
            </Viewbox>
            <TextBlock Text="No NFC device available. If your device has a NFC chip please make sure it is not turned off on your system settings." Style="{StaticResource BodyTextBlockStyle}" Margin="10,10,10,0"/>
        </StackPanel>

        <Grid x:Name="GridForm">
            <Canvas HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,24,56,0">
                <Path Fill="#FFFFFF" Data="M20 2H4C2.9 2 2 2.9 2 4v16c0 1.1 0.9 2 2 2h16c1.1 0 2-0.9 2-2V4C22 2.9 21.1 2 20 2z M20 20H4V4h16V20z M18 6h-5c-1.1 0-2 0.9-2 2v2.3c-0.6 0.3-1 1-1 1.7c0 1.1 0.9 2 2 2c1.1 0 2-0.9 2-2c0-0.7-0.4-1.4-1-1.7V8h3v8H8V8h2V6H8H6v12h12V6z" RenderTransformOrigin="0.5,0.5">
                    <Path.RenderTransform>
                        <CompositeTransform ScaleX="2" ScaleY="2"/>
                    </Path.RenderTransform>
                </Path>
            </Canvas>

            <TextBlock x:Name="LabelTitle" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="NFC Trigger" VerticalAlignment="Top" Style="{StaticResource HeaderTextBlockStyle}" FontFamily="Global User Interface"/>
            <TextBlock x:Name="LabelUrl" HorizontalAlignment="Left" Margin="10,110,0,0" TextWrapping="Wrap" Text="URL to trigger" VerticalAlignment="Top" Style="{StaticResource BodyTextBlockStyle}"/>
            <TextBox x:Name="TxtUrl" Margin="10,140,10,0" TextWrapping="Wrap" Text="https://" VerticalAlignment="Top" Height="40"/>
            <TextBlock x:Name="LabelMessage" HorizontalAlignment="Left" Margin="10,200,0,0" TextWrapping="Wrap" Text="Confirmation message (optional)" VerticalAlignment="Top" Style="{StaticResource BodyTextBlockStyle}"/>
            <TextBox x:Name="TxtMessage" Margin="10,230,10,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Height="80"/>
            <TextBlock x:Name="LabelConfirmation" HorizontalAlignment="Left" Margin="10,330,0,0" TextWrapping="Wrap" Text="Show confirmation as:" VerticalAlignment="Top" Style="{StaticResource BodyTextBlockStyle}"/>
            <RadioButton x:Name="ChkNotification" Content="Notification" Margin="10,350,0,0" GroupName="Confirmation" IsChecked="True"/>
            <RadioButton x:Name="ChkAppMessage" Content="Message on app" Margin="170,350,0,0" GroupName="Confirmation"/>
           
            <Button x:Name="ButWrite" Content="Write tag" HorizontalAlignment="Stretch" Margin="10,460,10,0" Height="74" BorderThickness="0" Background="#FFB200FF" Click="ButWrite_Click"/>
            <Button x:Name="ButWriteCancel" Content="Cancel" HorizontalAlignment="Stretch" Margin="10,460,10,0" Height="74" BorderThickness="0" Background="#FF777777" Click="ButWriteCancel_Click" Visibility="Collapsed"/>
            
            <TextBlock x:Name="LabelWriting" HorizontalAlignment="Left" Margin="10,452,0,0" Text="Touch your device on the NFC tag..." VerticalAlignment="Top" Style="{StaticResource BodyTextBlockStyle}"/>
            <ProgressBar x:Name="LoadingWriting" Height="10" Margin="10,478,10,0" VerticalAlignment="Top" IsIndeterminate="True"/>
        </Grid>
    </Grid>

    <Page.BottomAppBar>
        <CommandBar IsSticky="True" x:Name="appBar">
            <CommandBar.PrimaryCommands>
                <AppBarButton x:Name="BarRead" Icon="View" IsCompact="False" Label="Read tag" Click="BarRead_Click"/>
                <AppBarButton x:Name="BarHelp" Icon="Help" IsCompact="False" Label="Help" Click="BarHelp_Click"/>
            </CommandBar.PrimaryCommands>
        </CommandBar>
    </Page.BottomAppBar>
</Page>